package com.ticket.sass.common.printer.service;

import com.ticket.sass.common.printer.config.PrinterConfig;
import com.ticket.sass.common.printer.dto.AccessTokenResult;
import com.ticket.sass.common.printer.dto.PrintResult;

/**
 * @author ywb
 * @date 2024-05-06 16:10
 */
public interface PrinterService {
    AccessTokenResult print(String content);
    
    <U extends PrinterConfig> void setConfig(U printerConfig);
    
    <U extends Listener> void setLister(U listener);
    
    interface Listener {
        void onSuccess(PrintResult printResult);
        void onFail(PrintResult printResult);
        void onRefreshAccessToken(String accessToken);
        void onRefreshAccessTokenFail(String errorMessage);
    }
}
